<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<%@page import="java.util.*,com.xiaoao.net.utils.*,com.card.log.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Admin</title>
<meta name="description" content="Administry - Admin Template by www.865171.cn" />
<meta name="keywords" content="Admin,Template" />
<link rel="shortcut icon" type="image/png" HREF="img/favicons/favicon.png"/>
<link rel="icon" type="image/png" HREF="img/favicons/favicon.png"/>
<link rel="apple-touch-icon" HREF="img/favicons/apple.png" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
<link rel="stylesheet" href="css/custom.css" type="text/css" />
<link rel="stylesheet" type="text/css"
	href="css/jquery-ui-1.8.17.custom.css" />
<link rel="stylesheet" type="text/css" href="js/jqgrid/ui.jqgrid.css" />
<script type="text/javascript" SRC="js/swfobject.js"></script>
<script type="text/javascript" SRC="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" SRC="js/jquery.ui.core.min.js"></script>
<script type="text/javascript" SRC="js/jquery.ui.widget.min.js"></script>
<script type="text/javascript" SRC="js/jquery.ui.tabs.min.js"></script>
<script type="text/javascript" SRC="js/jquery.tipTip.min.js"></script>
<script type="text/javascript" SRC="js/jquery.superfish.min.js"></script>
<script type="text/javascript" SRC="js/jquery.supersubs.min.js"></script>
<script type="text/javascript" SRC="js/jquery.validate_pack.js"></script>
<script type="text/javascript" SRC="js/jquery.nyroModal.pack.js"></script>
<script type="text/javascript" SRC="js/jquery.dataTables.min.js"></script>
<script type="text/javascript"
	src="js/timepack/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript"
	src="js/timepack/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript"
	src="js/timepack/jquery-ui-timepicker-zh-CN.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function(){
	
	/* setup navigation, content boxes, etc... */
	Administry.setup();
	
	/* datatable */
	$('#table').dataTable({
        /* searching : false, //去掉搜索框方法一：百度上的方法，但是我用这没管用
        sDom : '"top"i',   //去掉搜索框方法二：这种方法可以，动态获取数据时会引起错误
        bFilter: false,    //去掉搜索框方法三：这种方法可以 */
        bLengthChange: false,   //去掉每页显示多少条数据方法
    });
	
	/* expandable rows */
	Administry.expandableRows();
});
$(function () {
    $(".ui_timepicker").datetimepicker({
        showSecond: true,
        timeFormat: '',
        stepHour: 1,
        stepMinute: 1,
        stepSecond: 1
    });
});
function find_exchange2() {
	var num = $("#pageNum").val();
	var uid = $("#userId").val();
	window.location.href="/GameServer/UserFkLog.jsp?pageNum="+num+"&userId="+uid;
}

</script>
<body>
<%
	List<UserGoldLog> mailList = new ArrayList<UserGoldLog>();
	String userId = request.getParameter("userId");
	int pageNum = 0;
	if(userId == null) {
		userId = "";
	}
	if(!userId.isEmpty()) {
		pageNum = PubFunc.parseInt(request.getParameter("pageNum"));
		if(pageNum <= 0) pageNum = 1;
		mailList = LogUtils.getGoldLog(userId,pageNum);
	}
%>
	<!-- Header -->
	<%@include file="head.jsp" %>
	<div id="page">
		<!-- Wrapper -->
		<div class="wrapper">
			<hr />
			<p>
				<p>
					<label class="required">当前页:</label>
					<input type="text" id="pageNum"  value="<%=pageNum %>" name="pageNum" />
					<input type="text" id="userId"  value="<%=userId %>" name="userId" />
					<input type="button" onclick="find_exchange2()" class="btn btn-green big" value="查询" onclick="find_exchange2()" />
					<input type="button" onclick="location.href='/GameServer/UserFkLog.jsp?userId=<%=userId %>&pageNum=<%=pageNum-1 %>'" class="btn btn-green big" value="上一页" onclick="find_exchange2()" />
					<input type="button" onclick="location.href='/GameServer/UserFkLog.jsp?userId=<%=userId %>&pageNum=<%=pageNum+1 %>'" class="btn btn-green big" value="下一页" onclick="find_exchange2()" />
				</p>
				&nbsp;
			</p>
			<section class="column width8 first">
					<div class="clear">&nbsp;</div>
					<table class="display stylized" id="table">
						<thead>
							<tr>
								<th>日期</th>
								<th>事件</th>
								<th>房卡数</th>
							</tr>
						</thead>
						<tbody id="mainbody">
						<% 
							for(int i = 0;i < mailList.size();i++){
								UserGoldLog gn = mailList.get(i); 
						%>
						
							<tr class="gradeX" id="tr<%=i %>">
								<td><%=gn.getDate()%></td>
								<td><%=gn.getEvent()%></td>
								<td><%=gn.getSpend()%></td>
							</tr>
						<%
							}
						%>
						<tfoot>
							<tr>
								<th>日期</th>
								<th>事件</th>
								<th>房卡数</th>
							</tr>
						</tfoot>
					</table>
					<div class="clear">&nbsp;</div>
			</section>
			
		</div>
	</div>
	<footer id="bottom">
		<div class="wrapper-login">
			<p>Copyright &copy; 2013 <b><a HREF="http://www.jqz.com" title="www.jqz.com">www.jqz.com</a></b> | Icons by <a HREF="http://www.jqz.com">jqz</a></p>
		</div>
		
	</footer>
	<a href="#" id="totop">^ scroll to top</a>
	<script type="text/javascript" SRC="js/administry.js"></script>
</body>
</html>